package com.ccys.db.mapper;

import com.alibaba.fastjson.JSONObject;
import com.ccys.db.dto.doctor.patientHistory.DoctorVerifyPackedMedicationDto;
import com.ccys.db.entity.TblBookingPrescription;
import com.ccys.db.vo.doctor.patientHistory.BookingInfoVo;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.Mapper;
import tk.mybatis.mapper.common.MySqlMapper;

import java.util.List;

/**
* Created by Mybatis Generator on 2023/12/26
*/
public interface TblBookingPrescriptionMapper extends Mapper<TblBookingPrescription>, MySqlMapper<TblBookingPrescription> {
    Integer findRebuyCountByMenberId(@Param("memberId") String memberId);

    void doctorApproveMedications(@Param("doctorId") String doctorId,@Param("bookingId") String bookingId);

    List<BookingInfoVo.Pharmacy> selectBookingInfoPharmacyList(@Param("bookingId")String bookingId);

    List<BookingInfoVo.Step_dose_medications> selectBookingInfoPrescriptionList(@Param("bookingId")String bookingId);

    int updateVerifyPacked(DoctorVerifyPackedMedicationDto dto);

    void updateStatusCoveredDiagnosis(@Param("bookingId") String bookingId,@Param("productId") String productId,@Param("status") Integer status);

    void updateDelFlagByIds(@Param("ids") List<String> ids);

    void updateShowByBookingId(@Param("bookingId") String bookingId);

    List<String> findProductIdsByProductIdsNotInAndByBookingId(@Param("productIds") List<String> productIds,@Param("bookingId") String bookingId);

    int updateStatusByIndoCheckout(@Param("status")Integer status,@Param("bookingId")String bookingId,@Param("thirdIds")String thirdIds);

    List<JSONObject> selectByIndoCheckout(@Param("bookingId")String bookingId,@Param("thirdIds")String thirdIds);

    List<TblBookingPrescription> findByBookingId(@Param("bookingId") String bookingId);

    Integer findCountByBookingId(@Param("bookingId") String bookingId);

    void updateDelFlagTrueByBookingId(@Param("bookingId") String bookingId);

       /**
        * @description 统计bookingId 处方
        * @date     2024/3/8
        * @author   cloud fly
        */
    Integer countBookingPrescription(@Param("bookingId") String bookingId);
}